Optimal. Leaf size=154 \[ -\frac {3 \sqrt {a} \tanh ^{-1}\left (\frac {\sqrt {a} \sqrt {d} \cos (e+f x)}{\sqrt {c+d} \sqrt {a+a \sin (e+f x)}}\right )}{4 \sqrt {d} (c+d)^{5/2} f}-\frac {a \cos (e+f x)}{2 (c+d) f \sqrt {a+a \sin (e+f x)} (c+d \sin (e+f x))^2}-\frac {3 a \cos (e+f x)}{4 (c+d)^2 f \sqrt {a+a \sin (e+f x)} (c+d \sin (e+f x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.19, antiderivative size = 154, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {2851, 2852,
214} \begin {gather*} -\frac {3 a \cos (e+f x)}{4 f (c+d)^2 \sqrt {a \sin (e+f x)+a} (c+d \sin (e+f x))}-\frac {a \cos (e+f x)}{2 f (c+d) \sqrt {a \sin (e+f x)+a} (c+d \sin (e+f x))^2}-\frac {3 \sqrt {a} \tanh ^{-1}\left (\frac {\sqrt {a} \sqrt {d} \cos (e+f x)}{\sqrt {c+d} \sqrt {a \sin (e+f x)+a}}\right )}{4 \sqrt {d} f (c+d)^{5/2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 214
Rule 2851
Rule 2852
Rubi steps
\begin {align*} \int \frac {\sqrt {a+a \sin (e+f x)}}{(c+d \sin (e+f x))^3} \, dx &=-\frac {a \cos (e+f x)}{2 (c+d) f \sqrt {a+a \sin (e+f x)} (c+d \sin (e+f x))^2}+\frac {3 \int \frac {\sqrt {a+a \sin (e+f x)}}{(c+d \sin (e+f x))^2} \, dx}{4 (c+d)}\\ &=-\frac {a \cos (e+f x)}{2 (c+d) f \sqrt {a+a \sin (e+f x)} (c+d \sin (e+f x))^2}-\frac {3 a \cos (e+f x)}{4 (c+d)^2 f \sqrt {a+a \sin (e+f x)} (c+d \sin (e+f x))}+\frac {3 \int \frac {\sqrt {a+a \sin (e+f x)}}{c+d \sin (e+f x)} \, dx}{8 (c+d)^2}\\ &=-\frac {a \cos (e+f x)}{2 (c+d) f \sqrt {a+a \sin (e+f x)} (c+d \sin (e+f x))^2}-\frac {3 a \cos (e+f x)}{4 (c+d)^2 f \sqrt {a+a \sin (e+f x)} (c+d \sin (e+f x))}-\frac {(3 a) \text {Subst}\left (\int \frac {1}{a c+a d-d x^2} \, dx,x,\frac {a \cos (e+f x)}{\sqrt {a+a \sin (e+f x)}}\right )}{4 (c+d)^2 f}\\ &=-\frac {3 \sqrt {a} \tanh ^{-1}\left (\frac {\sqrt {a} \sqrt {d} \cos (e+f x)}{\sqrt {c+d} \sqrt {a+a \sin (e+f x)}}\right )}{4 \sqrt {d} (c+d)^{5/2} f}-\frac {a \cos (e+f x)}{2 (c+d) f \sqrt {a+a \sin (e+f x)} (c+d \sin (e+f x))^2}-\frac {3 a \cos (e+f x)}{4 (c+d)^2 f \sqrt {a+a \sin (e+f x)} (c+d \sin (e+f x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains higher order function than in optimal. Order 9 vs. order 3 in
optimal.
time = 5.23, size = 920, normalized size = 5.97 \begin {gather*} \frac {\left (\frac {1}{16}+\frac {i}{16}\right ) \sqrt {a (1+\sin (e+f x))} \left (\frac {3 \left (\cos \left (\frac {e}{2}\right )+i \sin \left (\frac {e}{2}\right )\right ) \left ((-1+i) x \cos (e)+\frac {\text {RootSum}\left [-d+2 i c e^{i e} \text {$\#$1}^2+d e^{2 i e} \text {$\#$1}^4\&,\frac {(1+i) d \sqrt {e^{-i e}} f x-(2-2 i) d \sqrt {e^{-i e}} \log \left (e^{\frac {i f x}{2}}-\text {$\#$1}\right )-i \sqrt {d} \sqrt {c+d} f x \text {$\#$1}+2 \sqrt {d} \sqrt {c+d} \log \left (e^{\frac {i f x}{2}}-\text {$\#$1}\right ) \text {$\#$1}+\frac {(1-i) c f x \text {$\#$1}^2}{\sqrt {e^{-i e}}}+\frac {(2+2 i) c \log \left (e^{\frac {i f x}{2}}-\text {$\#$1}\right ) \text {$\#$1}^2}{\sqrt {e^{-i e}}}-\sqrt {d} \sqrt {c+d} e^{i e} f x \text {$\#$1}^3-2 i \sqrt {d} \sqrt {c+d} e^{i e} \log \left (e^{\frac {i f x}{2}}-\text {$\#$1}\right ) \text {$\#$1}^3}{d-i c e^{i e} \text {$\#$1}^2}\&\right ] (\cos (e)+i (-1+\sin (e))) \sqrt {\cos (e)-i \sin (e)}}{4 f}+(1+i) x \sin (e)\right )}{\sqrt {d} (c+d)^{5/2} (\cos (e)+i (-1+\sin (e))) \sqrt {\cos (e)-i \sin (e)}}+\frac {3 \left (\cos \left (\frac {e}{2}\right )+i \sin \left (\frac {e}{2}\right )\right ) \left ((1-i) x \cos (e)-(1+i) x \sin (e)+\frac {\text {RootSum}\left [-d+2 i c e^{i e} \text {$\#$1}^2+d e^{2 i e} \text {$\#$1}^4\&,\frac {(1-i) d \sqrt {e^{-i e}} f x+(2+2 i) d \sqrt {e^{-i e}} \log \left (e^{\frac {i f x}{2}}-\text {$\#$1}\right )+\sqrt {d} \sqrt {c+d} f x \text {$\#$1}+2 i \sqrt {d} \sqrt {c+d} \log \left (e^{\frac {i f x}{2}}-\text {$\#$1}\right ) \text {$\#$1}-\frac {(1+i) c f x \text {$\#$1}^2}{\sqrt {e^{-i e}}}+\frac {(2-2 i) c \log \left (e^{\frac {i f x}{2}}-\text {$\#$1}\right ) \text {$\#$1}^2}{\sqrt {e^{-i e}}}-i \sqrt {d} \sqrt {c+d} e^{i e} f x \text {$\#$1}^3+2 \sqrt {d} \sqrt {c+d} e^{i e} \log \left (e^{\frac {i f x}{2}}-\text {$\#$1}\right ) \text {$\#$1}^3}{d-i c e^{i e} \text {$\#$1}^2}\&\right ] \sqrt {\cos (e)-i \sin (e)} (-1-i \cos (e)+\sin (e))}{4 f}\right )}{\sqrt {d} (c+d)^{5/2} (\cos (e)+i (-1+\sin (e))) \sqrt {\cos (e)-i \sin (e)}}-\frac {(4-4 i) \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right )}{(c+d) f (c+d \sin (e+f x))^2}-\frac {(6-6 i) \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right )}{(c+d)^2 f (c+d \sin (e+f x))}\right )}{\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 4.88, size = 254, normalized size = 1.65
method | result | size |
default | \(-\frac {\left (1+\sin \left (f x +e \right )\right ) \sqrt {-a \left (\sin \left (f x +e \right )-1\right )}\, \left (3 \arctanh \left (\frac {\sqrt {-a \left (\sin \left (f x +e \right )-1\right )}\, d}{\sqrt {a \left (c +d \right ) d}}\right ) \left (\sin ^{2}\left (f x +e \right )\right ) a \,d^{2}+6 \arctanh \left (\frac {\sqrt {-a \left (\sin \left (f x +e \right )-1\right )}\, d}{\sqrt {a \left (c +d \right ) d}}\right ) \sin \left (f x +e \right ) a c d +3 \sqrt {-a \left (\sin \left (f x +e \right )-1\right )}\, \sqrt {a \left (c +d \right ) d}\, \sin \left (f x +e \right ) d +3 \arctanh \left (\frac {\sqrt {-a \left (\sin \left (f x +e \right )-1\right )}\, d}{\sqrt {a \left (c +d \right ) d}}\right ) a \,c^{2}+5 \sqrt {-a \left (\sin \left (f x +e \right )-1\right )}\, \sqrt {a \left (c +d \right ) d}\, c +2 \sqrt {-a \left (\sin \left (f x +e \right )-1\right )}\, \sqrt {a \left (c +d \right ) d}\, d \right )}{4 \left (c +d \right )^{2} \left (c +d \sin \left (f x +e \right )\right )^{2} \sqrt {a \left (c +d \right ) d}\, \cos \left (f x +e \right ) \sqrt {a +a \sin \left (f x +e \right )}\, f}\) | \(254\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 487 vs.
\(2 (138) = 276\).
time = 0.52, size = 1304, normalized size = 8.47 \begin {gather*} \left [\frac {3 \, {\left (d^{2} \cos \left (f x + e\right )^{3} + {\left (2 \, c d + d^{2}\right )} \cos \left (f x + e\right )^{2} - c^{2} - 2 \, c d - d^{2} - {\left (c^{2} + d^{2}\right )} \cos \left (f x + e\right ) + {\left (d^{2} \cos \left (f x + e\right )^{2} - 2 \, c d \cos \left (f x + e\right ) - c^{2} - 2 \, c d - d^{2}\right )} \sin \left (f x + e\right )\right )} \sqrt {\frac {a}{c d + d^{2}}} \log \left (\frac {a d^{2} \cos \left (f x + e\right )^{3} - a c^{2} - 2 \, a c d - a d^{2} - {\left (6 \, a c d + 7 \, a d^{2}\right )} \cos \left (f x + e\right )^{2} + 4 \, {\left (c^{2} d + 4 \, c d^{2} + 3 \, d^{3} - {\left (c d^{2} + d^{3}\right )} \cos \left (f x + e\right )^{2} + {\left (c^{2} d + 3 \, c d^{2} + 2 \, d^{3}\right )} \cos \left (f x + e\right ) - {\left (c^{2} d + 4 \, c d^{2} + 3 \, d^{3} + {\left (c d^{2} + d^{3}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )\right )} \sqrt {a \sin \left (f x + e\right ) + a} \sqrt {\frac {a}{c d + d^{2}}} - {\left (a c^{2} + 8 \, a c d + 9 \, a d^{2}\right )} \cos \left (f x + e\right ) + {\left (a d^{2} \cos \left (f x + e\right )^{2} - a c^{2} - 2 \, a c d - a d^{2} + 2 \, {\left (3 \, a c d + 4 \, a d^{2}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{d^{2} \cos \left (f x + e\right )^{3} + {\left (2 \, c d + d^{2}\right )} \cos \left (f x + e\right )^{2} - c^{2} - 2 \, c d - d^{2} - {\left (c^{2} + d^{2}\right )} \cos \left (f x + e\right ) + {\left (d^{2} \cos \left (f x + e\right )^{2} - 2 \, c d \cos \left (f x + e\right ) - c^{2} - 2 \, c d - d^{2}\right )} \sin \left (f x + e\right )}\right ) + 4 \, {\left (3 \, d \cos \left (f x + e\right )^{2} + {\left (5 \, c + 2 \, d\right )} \cos \left (f x + e\right ) + {\left (3 \, d \cos \left (f x + e\right ) - 5 \, c + d\right )} \sin \left (f x + e\right ) + 5 \, c - d\right )} \sqrt {a \sin \left (f x + e\right ) + a}}{16 \, {\left ({\left (c^{2} d^{2} + 2 \, c d^{3} + d^{4}\right )} f \cos \left (f x + e\right )^{3} + {\left (2 \, c^{3} d + 5 \, c^{2} d^{2} + 4 \, c d^{3} + d^{4}\right )} f \cos \left (f x + e\right )^{2} - {\left (c^{4} + 2 \, c^{3} d + 2 \, c^{2} d^{2} + 2 \, c d^{3} + d^{4}\right )} f \cos \left (f x + e\right ) - {\left (c^{4} + 4 \, c^{3} d + 6 \, c^{2} d^{2} + 4 \, c d^{3} + d^{4}\right )} f + {\left ({\left (c^{2} d^{2} + 2 \, c d^{3} + d^{4}\right )} f \cos \left (f x + e\right )^{2} - 2 \, {\left (c^{3} d + 2 \, c^{2} d^{2} + c d^{3}\right )} f \cos \left (f x + e\right ) - {\left (c^{4} + 4 \, c^{3} d + 6 \, c^{2} d^{2} + 4 \, c d^{3} + d^{4}\right )} f\right )} \sin \left (f x + e\right )\right )}}, -\frac {3 \, {\left (d^{2} \cos \left (f x + e\right )^{3} + {\left (2 \, c d + d^{2}\right )} \cos \left (f x + e\right )^{2} - c^{2} - 2 \, c d - d^{2} - {\left (c^{2} + d^{2}\right )} \cos \left (f x + e\right ) + {\left (d^{2} \cos \left (f x + e\right )^{2} - 2 \, c d \cos \left (f x + e\right ) - c^{2} - 2 \, c d - d^{2}\right )} \sin \left (f x + e\right )\right )} \sqrt {-\frac {a}{c d + d^{2}}} \arctan \left (\frac {\sqrt {a \sin \left (f x + e\right ) + a} {\left (d \sin \left (f x + e\right ) - c - 2 \, d\right )} \sqrt {-\frac {a}{c d + d^{2}}}}{2 \, a \cos \left (f x + e\right )}\right ) - 2 \, {\left (3 \, d \cos \left (f x + e\right )^{2} + {\left (5 \, c + 2 \, d\right )} \cos \left (f x + e\right ) + {\left (3 \, d \cos \left (f x + e\right ) - 5 \, c + d\right )} \sin \left (f x + e\right ) + 5 \, c - d\right )} \sqrt {a \sin \left (f x + e\right ) + a}}{8 \, {\left ({\left (c^{2} d^{2} + 2 \, c d^{3} + d^{4}\right )} f \cos \left (f x + e\right )^{3} + {\left (2 \, c^{3} d + 5 \, c^{2} d^{2} + 4 \, c d^{3} + d^{4}\right )} f \cos \left (f x + e\right )^{2} - {\left (c^{4} + 2 \, c^{3} d + 2 \, c^{2} d^{2} + 2 \, c d^{3} + d^{4}\right )} f \cos \left (f x + e\right ) - {\left (c^{4} + 4 \, c^{3} d + 6 \, c^{2} d^{2} + 4 \, c d^{3} + d^{4}\right )} f + {\left ({\left (c^{2} d^{2} + 2 \, c d^{3} + d^{4}\right )} f \cos \left (f x + e\right )^{2} - 2 \, {\left (c^{3} d + 2 \, c^{2} d^{2} + c d^{3}\right )} f \cos \left (f x + e\right ) - {\left (c^{4} + 4 \, c^{3} d + 6 \, c^{2} d^{2} + 4 \, c d^{3} + d^{4}\right )} f\right )} \sin \left (f x + e\right )\right )}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.51, size = 222, normalized size = 1.44 \begin {gather*} -\frac {\sqrt {2} \sqrt {a} {\left (\frac {3 \, \sqrt {2} \arctan \left (\frac {\sqrt {2} d \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{\sqrt {-c d - d^{2}}}\right ) \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}{{\left (c^{2} + 2 \, c d + d^{2}\right )} \sqrt {-c d - d^{2}}} + \frac {2 \, {\left (6 \, d \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right ) \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 5 \, c \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right ) \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 5 \, d \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right ) \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}}{{\left (2 \, d \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - c - d\right )}^{2} {\left (c^{2} + 2 \, c d + d^{2}\right )}}\right )}}{8 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {\sqrt {a+a\,\sin \left (e+f\,x\right )}}{{\left (c+d\,\sin \left (e+f\,x\right )\right )}^3} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________